<template>
	<view class="index-wrapper" :class="{borderShow:isBorader}">
		<view class='wrapper' v-if=" likeInfo.length">
			<view class='title acea-row row-between-wrapper'>
				<view class='text'>
					<view class='name line1'>{{titleInfo[0].val}}</view>
				</view>
        <view class="text-more" @click="tiplod">
          查看更多
          <text class="iconfont icon-xiangyou"></text>
        </view>
			</view>
			<promotionGood :benefit="likeInfo"></promotionGood>
		</view>
	</view>
</template>

<script>
	import { mapState} from 'vuex'
	import promotionGood from '@/components/promotionGood/index.vue'
	export default {
		name: 'j_promotion',
		props: {
			dataConfig: {
				type: Object,
				default: () => {}
			},
			activeName: {
				type: String,
				default: ''
			},
		},
		components:{
			promotionGood
    },
    created() {
    },
		computed: {
			...mapState({
		    data: state => state.indexData.indexDatas. likeInfo
      })
		},
		watch:{
			'data': {
					handler (nVal) {
              console.log('侦听到了变化',nVal);
							this. likeInfo = nVal
					},
					deep: true
			},
			activeName: {
				handler(nVal) {
          console.log('woshi',nVal);
					if (nVal == this.name) {
						this.isBorader = true
					} else {
						this.isBorader = false
					}
				},
				deep: true
			}
		},
		data() {
			return {
				likeInfo:[],
				salesInfo:"拼团活动",
				titleInfo:this.dataConfig.titleInfo.list[0].chiild,
				isBorader:false,
				name: this.$options.name
			}
		},
		methods:{
      tiplod() {
        uni.switchTab({
					url:'/pages/users/pingtuan/pingtuan'
				})
      }
		}
	}
</script>

<style>
.text-more {
  color: #6666;
}
</style>
